//
//  USHeaderDayView.m
//  us
//
//  Created by karry on 2025/4/16.
//

#import "USHeaderDayView.h"

@implementation USHeaderDayView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

- (void)awakeFromNib {
    [super awakeFromNib];

    // 创建阴影容器
    UIView *shadowView = [[UIView alloc] init];
    [self insertSubview:shadowView atIndex:0];

    [shadowView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.mas_equalTo(0);
    }];

    // 设置阴影（不要加 masksToBounds）
    shadowView.layer.shadowColor = UIColor.clearColor.CGColor;
    shadowView.layer.shadowOffset = CGSizeMake(2, 2);
    shadowView.layer.shadowOpacity = 0.3;
    shadowView.layer.shadowRadius = 0.3;

    // 创建内容容器，带圆角
    UIView *contentView = [[UIView alloc] init];
    contentView.backgroundColor = [UIColor whiteColor]; // 或其他背景
    contentView.layer.cornerRadius = 8;
    contentView.layer.masksToBounds = YES;
    contentView.layer.maskedCorners = kCALayerMinXMinYCorner|kCALayerMaxXMinYCorner;

    [shadowView addSubview:contentView];
    [contentView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.mas_equalTo(0);
    }];

    // 把你的其他子视图加到 contentView 上（v0, v1）
    [contentView addSubview:self.v0];
    [contentView addSubview:self.v1];
    
    self.v0.backgroundColor = [UIColor jk_colorWithHex:0xE1DAC0];
    self.v1.backgroundColor = [UIColor mi_1_color];
}

@end
